package com.cy.controller;

import com.cy.service.RemoteProviderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 小李
 * @version 1.0
 * @date 2021/8/28 11:39
 */
@RestController
@RequestMapping("/consumer/")
public class FeignConsumerController {

    @Autowired
    private RemoteProviderService remoteProviderService;

    //http://ip:port/consumer/hello
    @GetMapping("/echo/{msg}")
    public String doEcho(@PathVariable String msg){
        //执行远程调用
        return remoteProviderService.echoMessage(msg);

    }

}
